libxl: make libxl_cd_insert "eject" + "insert"
authorWei Liu <wei.liu2@citrix.com>
Tue, 16 Sep 2014 10:01:13 +0000 (11:01 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Sep 2014 18:59:22 +0000 (19:59 +0100)
commit577314768b430107845023d7e489ed0dd53892ad
tree711ba4426980972b0ab88e1bb15d1b8b561468cb
parent4197d3abbb3055d3798254eb7ba239bfb5824360
libxl: make libxl_cd_insert "eject" + "insert"

We introduce an intermediate empty state when inserting media into
CDROM. The scheme works like this:

  lock json config
  write empty state to xenstore
  for (;;) {
      write user supplied disk to JSON
      write disk information to xenstore
  }
  unlock json config

Bear in mind that all steps can fail. With the proposed scheme, we now
know, if xenstore is empty, then CDROM should be considered empty;
otherwise we should use JSON version of CDROM configuration.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c